home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_demo-version / egs_devels / c-include / egsgfx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  4.8 KB  |  192 lines

  1. #ifndef EGS_EGSGFX_H
  2. #define EGS_EGSGFX_H
  3.  
  4. /***************************************************************************\
  5. *  $
  6. *  $ FILE     : egsgfx.h
  7. *  $ VERSION  : 1
  8. *  $ REVISION : 2
  9. *  $ DATE     : 02-Feb-93 22:24
  10. *  $
  11. *  $ Author   : mvk
  12. *  $
  13. *
  14. *****************************************************************************
  15. *                                                                           *
  16. * (c) Copyright 1990/93 VIONA Development                                   *
  17. *     All Rights Reserved                                                   *
  18. *                                                                           *
  19. \***************************************************************************/
  20.  
  21. #ifndef         EXEC_TYPES_H
  22. #include        <exec/types.h>
  23. #endif
  24. #ifndef         EXEC_PORTS_H
  25. #include        <exec/ports.h>
  26. #endif
  27. #ifndef         EXEC_LISTS_H
  28. #include        <exec/lists.h>
  29. #endif
  30. #ifndef         EXEC_SEMAPHORES_H
  31. #include        <exec/semaphores.h>
  32. #endif
  33. #ifndef         GRAPHICS_TEXT_H
  34. #include        <graphics/text.h>
  35. #endif
  36. #ifndef         EGS_EGS_H
  37. #include        <egs/egs.h>
  38. #endif
  39. #ifndef         EGS_EGSBLIT_H
  40. #include        <egs/egsblit.h>
  41. #endif
  42. #ifndef         EGS_EGSLAYERS_H
  43. #include        <egs/egslayers.h>
  44. #endif
  45.  
  46.  
  47. /*
  48.  * This library uses "egslayers.library" and "egsblit.library".  It
  49.  * standardizes the access to layers and BitMaps and makes their usage easier.
  50.  *
  51.  * The functions resemble in a great part those of the "graphics.library".
  52.  * The basic structure is the RastPort which contains a layer, a BitMap
  53.  * and/or a screen.  All conventions are abided by (MouseOn..MouseOff,
  54.  * LockLayer..UnlockLayer).  You can clip with a layer and/or a region, just
  55.  * as you like.
  56.  */
  57.  
  58.  
  59.  
  60. /*
  61.  * DrawModes
  62.  *
  63.  * States that define the color distribution for drawing operations.
  64.  *
  65.  *   DRAW_APEN  : You draw with the APen on transparent background.
  66.  *   DRAW_ABPEN : You draw with the APen in front and the BPen for the
  67.  *                 background.
  68.  *   INVERT     : You draw in inverting mode.
  69.  */
  70.  
  71. /* Enumeration type DrawMode has 8 bits ! */
  72. #define EG_DRAW_APEN  0
  73. #define EG_DRAW_ABPEN 1
  74. #define EG_INVERT     2
  75.  
  76.  
  77.  
  78. /*
  79.  * EFont, EFontPtr
  80.  *
  81.  * Extension of the Amiga TextFont structure with additional information.
  82.  * Created by "OpenFont" and destroyed by "CloseFont".
  83.  */
  84.  
  85. typedef struct EG_EFont *EG_EFontPtr;
  86.  
  87. struct EG_EFont {
  88.     struct TextFont  *Font;
  89.     struct E_EBitMap  EMap;
  90. };
  91.  
  92.  
  93.  
  94. /*
  95.  * PolyEntry, Polygon, PolyPtr
  96.  *
  97.  * Structures for polygons.
  98.  */
  99.  
  100. struct EG_PolyEntry {
  101.             WORD X, Y;
  102. };
  103.  
  104. typedef struct EG_PolyEntry EG_Polygon;
  105. typedef struct EG_PolyEntry *EG_PolyPtr;
  106.  
  107.  
  108.  
  109. /*
  110.  * AreaInfo, AreaInfoPtr
  111.  *
  112.  * Structure for Area commands, initialized by "InitArea".
  113.  */
  114.  
  115. typedef struct EG_AreaInfo *EG_AreaInfoPtr;
  116.  
  117. struct EG_AreaInfo {
  118.  
  119.     EG_PolyPtr  VctrTbl, VctrPtr, VctrLast;
  120.     WORD        Count, MaxCount;
  121. };
  122.  
  123.  
  124.  
  125. /*
  126.  * RastPort, RastPortPtr...
  127.  *
  128.  * Basic EGSGfx drawing structure:
  129.  *
  130.  *  .BitMap  : BitMap drawn into.
  131.  *  .Layer   : Layer drawn into.
  132.  *  .Screen  : Screen drawn into.
  133.  *
  134.  *  .cp_x,
  135.  *     cp_y  : Current drawing cursor, can be changed by "Move" or direct
  136.  *             access.
  137.  *  .am_x,
  138.  *     .am_y : Current area cursor, must be changed by "AreaMove".
  139.  *
  140.  *  .APen    : APen i.e. front pen.
  141.  *  .BPen    : BPen i.e. pen for background.
  142.  *
  143.  *  .Mode    : Drawing mode (see above).
  144.  *  .Font    : Current text font, can be changed by "SetFont" or direct access.
  145.  *
  146.  *  .Region  : ClipRegion, must be changed by "InstallClipRegion" or
  147.  *             "RemoveClipRegion".
  148.  *  .FClip,
  149.  *  .BClip   : PRIVATE !
  150.  *
  151.  *  .CurvStep: Bezier curves are split up into small lines.  This value
  152.  *             specifies the maximum length of such line segments.
  153.  *
  154.  *  .TmpRas  : Pointer to a one-planed BitMap that is to be used for Area
  155.  *             commands.  If the BitMap is missing each Area operation
  156.  *             allocates its own BitMap and frees it after processing.
  157.  *  .AreaInfo: AreaInfo structure.
  158.  *
  159.  * For reasons of compatibility no variables of the RastPort type may be
  160.  * used or created.  RastPorts can only be created by "CreateRastPort" and
  161.  * destroyed by "DeleteRastPort".
  162.  */
  163.  
  164. typedef struct EG_RastPort *EG_RastPortPtr;
  165.  
  166. struct EG_RastPort {
  167.  
  168.     E_EBitMapPtr    BitMap;
  169.     EL_LayerPtr     Layer;
  170.     E_EScreenPtr    Screen;
  171.     WORD            Depth;
  172.     WORD            cp_x, cp_y, am_x, am_y;         /* Commodore */
  173.     UWORD           Pad_1;
  174.     ULONG           APen, BPen;
  175.     UBYTE           DrawMode;
  176.     UBYTE           Pad_2, Pad_3, Pad_4;
  177.     EG_EFontPtr     Font;
  178.     EB_ClipRectPtr  Region;
  179.     EB_ClipRectPtr  FClip, BClip;
  180.     WORD            CurvStep;
  181.     UWORD           Pad_5;
  182.     E_EBitMapPtr    TmpRas;
  183.     EG_AreaInfoPtr  AreaInfo;
  184.     UBYTE           AlgoStyle;           /* Font style set has 8 bits */
  185.     UBYTE           Pad_6, Pad_7, Pad_8;
  186.     ULONG           Mask;
  187.     LONG            ClipKey;
  188.     LONG            Flags;  /* No flags defined yet */
  189. };
  190.  
  191. #endif
  192.